package generice;

import java.util.ArrayList;
import java.util.HashSet;

/**
 * 测试泛型上边界
 */
public class Demo2 {
    public static void main(String[] args) {
        TransferObject2 t1 = new TransferObject2();
        //可以不指定T，原型是Object

        //TransferObject2<Point> t2 = new TransferObject2<Point>();
        //编译错误，Point不是Collection的派生类

        TransferObject2<ArrayList> t2 = new TransferObject2<>();
        TransferObject2<HashSet> t3 = new TransferObject2<>();
        //ArrayList和HashSet都可以，是Collection的派生类
    }
}
